package com.ruoyi.stuhelp.service.impl;

import java.util.List;

import com.ruoyi.stuhelp.domain.vo.StudentCategoryHelpVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stuhelp.mapper.StudentsHelpMapper;
import com.ruoyi.stuhelp.domain.StudentsHelp;
import com.ruoyi.stuhelp.service.IStudentsHelpService;

/**
 * 校园公益Service业务层处理
 * 
 * @author atzxc
 * @date 2024-04-16
 */
@Service
public class StudentsHelpServiceImpl implements IStudentsHelpService 
{
    @Autowired
    private StudentsHelpMapper studentsHelpMapper;

    /**
     * 查询校园公益
     * 
     * @param shelpId 校园公益主键
     * @return 校园公益
     */
    @Override
    public StudentCategoryHelpVo selectStudentsHelpByShelpId(Long shelpId)
    {
        return studentsHelpMapper.selectStudentsAndCategoryHelpVoByShelpId(shelpId);
    }

    /**
     * 查询校园公益列表
     * 
     * @param studentsHelp 校园公益
     * @return 校园公益
     */
    @Override
    public List<StudentsHelp> selectStudentsHelpList(StudentsHelp studentsHelp)
    {
        return studentsHelpMapper.selectStudentsHelpList(studentsHelp);
    }

    /**
     * 新增校园公益
     * 
     * @param studentsHelp 校园公益
     * @return 结果
     */
    @Override
    public int insertStudentsHelp(StudentsHelp studentsHelp)
    {
        return studentsHelpMapper.insertStudentsHelp(studentsHelp);
    }

    /**
     * 修改校园公益
     * 
     * @param studentsHelp 校园公益
     * @return 结果
     */
    @Override
    public int updateStudentsHelp(StudentsHelp studentsHelp)
    {
        return studentsHelpMapper.updateStudentsHelp(studentsHelp);
    }

    /**
     * 批量删除校园公益
     * 
     * @param shelpIds 需要删除的校园公益主键
     * @return 结果
     */
    @Override
    public int deleteStudentsHelpByShelpIds(Long[] shelpIds)
    {
        return studentsHelpMapper.deleteStudentsHelpByShelpIds(shelpIds);
    }

    /**
     * 删除校园公益信息
     * 
     * @param shelpId 校园公益主键
     * @return 结果
     */
    @Override
    public int deleteStudentsHelpByShelpId(Long shelpId)
    {
        return studentsHelpMapper.deleteStudentsHelpByShelpId(shelpId);
    }







    /**
     * 多表联合 - 查询列表 我要转卖 和 失物招领 的 表 以及 分类表 和 状态表
     *
     * @param studentCategoryHelpVo
     * @return 结果
     */
    @Override
    public List<StudentCategoryHelpVo> selectStudentsAndCategoryHelpList(StudentCategoryHelpVo studentCategoryHelpVo) {

        List<StudentCategoryHelpVo> studentCategoryHelpVos = studentsHelpMapper.selectStudentsAndCategoryHelpList(studentCategoryHelpVo);
        return studentCategoryHelpVos;
    }
}
